from decimal import Decimal
while True:
    a = input("请问要存多少钱?")
    if a.isdigit():
        break
    else:
        print("你乱输")
while True:
    b = input("你的目标金额是：")
    if b.isdigit():
        break
    else:
        print("你乱输")
a = Decimal(a)
b = Decimal(b)
x = 1
while a < b:
    a+= a*Decimal("0.05")
    print(f"第{x}年的本金加利息是:{a}")
    x+=1
print(f"到了第{x-1}年，能实现目标")

